package com.yjt.fresh.adpater;

import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yjt.fresh.R;
import com.yjt.fresh.bean.BeanUserComment;

import java.util.List;

/**
 * 我的评论
 * Created by mcc on 2018/6/10.
 */

public class AdpRvAtyCommentCenter extends BaseQuickAdapter<BeanUserComment.BeanUserCommentInfo, BaseViewHolder> {


    private boolean mIsComment;

    public void isComment(boolean isComment){
        mIsComment = isComment;
    }
    public AdpRvAtyCommentCenter(int layoutResId, @Nullable List<BeanUserComment.BeanUserCommentInfo> data) {
        super(layoutResId, data);
    }
    @Override
    protected void convert(BaseViewHolder helper, BeanUserComment.BeanUserCommentInfo item) {
        ImageView iv = helper.getView(R.id.ivAppRecycleItemAtyCommentCenter);
        TextView tvTitle = helper.getView(R.id.tvAppRecycleItemAtyCommentCenterTitle);
        TextView tvDetailOrComment = helper.getView(R.id.tvAppRecycleItemAtyCommentCenterDetailOrComment);

        Glide.with(mContext).load(item.getSKU_IMG()).into(iv);
        tvTitle.setText(item.getTITLE());
        helper.addOnClickListener(R.id.tvAppRecycleItemAtyCommentCenterDetailOrComment);

        if (mIsComment){
            tvDetailOrComment.setText("查看详情");
        }else {
            tvDetailOrComment.setText("评价");
        }
    }
}
